# 无限分类
def infinite(da):
    li = []
    dic = {}
    for item in da:
        dic[item["id"]] = item
    for i in da:
        if not i["pid"]:
            li.append(dic[i["id"]])
        else:
             if "children" not in dic[i["pid"]]:
                 dic[i["pid"]]["children"] = []
             dic[i["pid"]]["children"].append(dic[i["id"]])
    return li

